import echarts from 'vue-echarts'
var dataArr=[
  {value:50,sum:255},
  {value:198,sum:355},
  {value:56,sum:200},
  {value:79,sum: 150},
  {value:89,sum: 100},
  {value:156,sum:300},
  {value:50,sum:100},
  {value:198,sum:200},
  {value:56,sum:100},
  {value:79,sum:150},
  {value: 89,sum: 200},
  {value:89,sum:156}
]
export default {
  tooltip: {
  trigger: 'axis',
  formatter: function(params){
  return '本月任务量：'+ params[0].data.value+'<br/>本月完成量：'+params[0].data.sum
  },
  axisPointer: {
    label:{
      fontSize:12
    },
    lineStyle: {
      type: 'dashed',
      color: '#ff8687',
    },
    },
    backgroundColor: '#fe7778',
    position: function (point) {
      // 固定在顶部
      return [point[0]-50, '5%'];
    }
    },
    grid: {
      top: '12%',
      left: '5%',
      right: '5%',
      bottom: '15%'
    },
    xAxis: [{
      type: 'category',
      axisLine: {
      show: true,
      lineStyle:{
        color: '#e7e9eb',
        fontSize: 16
      }
    },
    axisLabel: {
      color: '#9599a4',
      margin: 15,
    },
    splitLine: {
      show: false
    },
    axisTick: {
      show: false
    },
    boundaryGap: true,
    data: ['1月', '2月', '3月', '4月', '5月', '6月','7月','8月','9月','10月','11月','12月'],
    }],
    yAxis: [{
      type: 'value',
      min: 0,
      splitNumber: 4,
      minInterval: 1,
      splitLine: {
      show: true,
      lineStyle: {
        color: 'rgba(255,255,255,0.1)'
      }
    },
    axisLine: {
      show: true,
      lineStyle:{
        color: '#e7e9eb',
      }
    },
    axisLabel: {
    show: true,
    margin: 12,
    textStyle: {
      color: '#9599a4',

    },
    },
    axisTick: {
    show: true,
    inside: true,
    length: 20
    },
    }],
    series: [
    {
      name: '本月任务量',
      type: 'line',
      symbolSize: 10,
      symbol: 'circle',
      smooth: true,
      showSymbol: false,
      lineStyle: {
        normal: {
            color: "#ff8182"
        },
      },
      itemStyle: {
        normal: {
            color: '#fff',
            borderColor: '#ff5357',
            borderWidth: 3
        }
      },
      tooltip: {
        show: true
      },
      areaStyle: {
        normal: {
            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                    offset: 0,
                    color: '#ffacad'
                },
                {
                    offset: 1,
                    color: 'rgba(255,252,252,0)'
                }
            ], false),
        }
      },
    data: dataArr
    }
  ]
};